#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/types.h>
int main()
{
    pid_t id = fork();
    if(id<0)
    {
        perror("fork");
        return 1;
    }
    else if(id == 0)
    {
        while(1){
        printf("I am child : %d;my parent : %d\n",getpid(),getppid());
        sleep(5);
        }
    }
    else
    {
        printf("I am parent : %d\n",getpid());
        sleep(3);
        exit(0);
    }
    return 0;
}
